<cfmodule template="../../tag/layout.cfm">
<!--- 表格显示 --->
<div id="grid"></div>
<div id="toolbar" style="display: none;">
	<form id="searchForm">
		<table>
			<tr>
				<td>供应商名称</td>
				<td><input name="supchsname" style="width: 180px;" /></td>
				<td>创建时间</td>
				<td>
					<input name="created_ge"  class="easyui-datebox" style="width:100px"/>
					-
					<input name="created_le"  class="easyui-datebox" style="width:100px"/>
				</td>
				<td>
					<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-zoom',plain:true" onclick="grid.datagrid('load',fw.serializeObject($('#searchForm')));">过滤</a>
					<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-zoom_out',plain:true" onclick="$('#searchForm input').val('');grid.datagrid('load',{});">重置过滤</a>
				</td>
			</tr>
		</table>
	</form>
</div>
</cfmodule>
<script type="application/javascript">
var closeDialog = function($dialog) {
	$dialog.dialog('destroy');
}

var submitForm = function($dialog,$supplierid,$suppliername) {
	rows = $('#grid').datagrid('getSelections');
	if(rows.length > 0){
		$supplierid.val( rows[0].id );
		$suppliername.val(rows[0].supchsname);
		$dialog.dialog('destroy');
	}else{
		$.messager.alert('提示','请选择供应商！','warning');
	}
};

$(function(){
	//列表操作
	var gird;
	grid = $('#grid').datagrid({
		fit: true,
		border:false,
		collapsible:false,
		pagination:true,
		singleSelect:true,
		rownumbers:true,
		sortName:'id',
		idField:'id',
		checkOnSelect:false,
		sortOrder:'desc',
		toolbar : '#toolbar',
		url:'?action=supplier.list',
		columns:[[
			{field:'ck',checkbox:true},
			{field:'id',title:'ID',width:40,sortable:true},
			{field:'supcode',title:'编号',width:80,sortable:true},
			{field:'supchsname',title:'供应商名称',width:250,sortable:true},
			{field:'gmporgspno',title:'GMP(GSP)认证',width:150,sortable:true},
			{field:'phone',title:'联系电话',width:150,sortable:true},
			{field:'ispublish',title:'审核',width:50,sortable:true,align:'center',
				formatter : function(value, row) {
					var str = '';
					if(value == 0){
						str = '未审核';
					}
					return str;
				}

			}
		]],
		onLoadSuccess : function(data) {
			$('.iconImg').attr('src', fw.pixel_0);
		}
	});


});
</script>